//
//  LSZNewRandombroadcastHeaderCell.m
//  JKFuYinProject
//
//  Created by 九酷 on 2017/9/28.
//  Copyright © 2017年 LC. All rights reserved.
//

#import "LSZNewRandombroadcastHeaderCell.h"

@implementation LSZNewRandombroadcastHeaderCell
-(id)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithReuseIdentifier:reuseIdentifier];
    if (self) {
        self.viewBig = [[UIView alloc]init];
        [self addSubview:self.viewBig];

        [self.viewBig addSubview:self.butPaly];
        self.butPaly = [[UIButton alloc]init];

        self.imageViewPlay = [[UIImageView alloc]init];
        self.imageViewPlay.image = [UIImage imageNamed:@"首页_赞美诗_播放图标"];
        self.imageViewPlay.userInteractionEnabled = YES;
        [self.viewBig addSubview:self.imageViewPlay];

        self.label =[[UILabel alloc]init];
        self.label.text = @"循环播放全部";
        self.label.userInteractionEnabled = YES;
        self.label.textColor = titleColorLSZ;
        [LSZSpecialPackaging setLabelAdaptiveSize:self.label font:14.5];
        [self.viewBig addSubview:self.label];

        self.butList = [[UIButton alloc]init];
        [self.viewBig addSubview:self.butList];

        self.imageViewList = [[UIImageView alloc]init];
        self.imageViewList.image = [UIImage imageNamed:@"当前播放列表"];
        self.imageViewList.userInteractionEnabled = YES;
        [self.butList addSubview:self.imageViewList];

        self.labelListName = [[UILabel alloc]init];
        self.labelListName.textColor = titleColorLSZ;
        self.labelListName.text = @"当前播放列表";
        self.labelListName.userInteractionEnabled = YES;
        self.labelListName.textAlignment = NSTextAlignmentRight;
        [LSZSpecialPackaging setLabelAdaptiveSize:self.labelListName font:14.5];
        [self.viewBig addSubview:self.labelListName];

        if (ScreenWidth == 320) {
            //5
            self.viewBig.frame = CGRectMake(0, 0, ScreenWidth, 35);
            self.butPaly.frame = CGRectMake(0, 0, 10+20+11, 35);
            self.imageViewPlay.frame = CGRectMake(10,(35-18)/2,18,18);
            self.imageViewList.frame = CGRectMake(15,(35-18)/2,20,18);
            self.label.frame = CGRectMake(CGRectGetMaxX(self.imageViewPlay.frame)+11, 0, 150, self.butPaly.frame.size.height);
            self.butList.frame = CGRectMake(ScreenWidth-55, 0, 55, self.butPaly.frame.size.height);
            self.labelListName.frame = CGRectMake(ScreenWidth-100-self.butList.frame.size.width,0, 100, self.viewBig.frame.size.height);
        }else if(ScreenWidth == 375){
            // 6 7
            self.viewBig.frame = CGRectMake(0, 0, ScreenWidth, 40);
            self.butPaly.frame = CGRectMake(0, 0, 10+24+11, 40);
            self.imageViewPlay.frame = CGRectMake(10,(40-22)/2, 22, 22);
            self.imageViewList.frame = CGRectMake(15,(40-19)/2,21,19);
            self.label.frame = CGRectMake(CGRectGetMaxX(self.imageViewPlay.frame)+11, 0, 150, self.butPaly.frame.size.height);
            self.butList.frame = CGRectMake(ScreenWidth-55, 0, 55, self.butPaly.frame.size.height);
            self.labelListName.frame = CGRectMake(ScreenWidth-100-self.butList.frame.size.width,0, 100, self.viewBig.frame.size.height);
        }else {
            //plus
            self.viewBig.frame = CGRectMake(0, 0, ScreenWidth, 48);
            self.butPaly.frame = CGRectMake(0, 0, 10+24+11, 48);
            self.imageViewPlay.frame = CGRectMake(10,(48-22)/2, 22, 22);
            self.imageViewList.frame = CGRectMake(15,(48-20)/2,22,20);
            self.label.frame = CGRectMake(CGRectGetMaxX(self.imageViewPlay.frame)+11, 0, 150, self.viewBig.frame.size.height);
            self.butList.frame = CGRectMake(ScreenWidth-55, 0, 55, self.butPaly.frame.size.height);
            self.labelListName.frame = CGRectMake(ScreenWidth-100-self.butList.frame.size.width,0, 100, self.viewBig.frame.size.height);
        }
        for (NSInteger i = 0; i < 2; i++) {
            UITapGestureRecognizer *nowListsTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(clickNowList)];
            if (i == 0) {
                [self.labelListName addGestureRecognizer:nowListsTap];
            }
            if (i == 1) {
                [self.imageViewList addGestureRecognizer:nowListsTap];
            }
        }
    }
    return self;
}
- (void)clickNowList {
    if (_nowListsBlock != nil) {
        _nowListsBlock();
    }
}
@end
